﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UploadFiles.ascx.cs" Inherits="UserControl_UploadFiles" %>
<link href="../CSS/css.css" rel="stylesheet" type="text/css" />

<script language="JavaScript" src="../js/AddTableRow.js"> </script>

<script language="JavaScript" src="../js/GeneralPage.js"> </script>
<style type="text/css" media="all">
@import "../CSS/global.css";
@import "../CSS/thickbox.css";
</style>

<link rel="alternate stylesheet" type="text/css" href="../CSS/1024.css" title="1024 x 768" />

<script src="../js/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
<script src="../js/thickbox-compressed.js" type="text/javascript"></script>
<script src="../js/global.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">
    var count = 1;
    function addFile() 
    {
        var fileBlock = document.getElementById("MultiFileDiv");
        var oDiv = document.createElement("div");
        
        
        oDiv.innerHTML= "<input type=\"file\" name=\"file_"+count+"\" /> "
                      + "<input type=\"button\" onclick=\"delFile(this)\""
                      + " value=\"删除\" />"
        fileBlock.appendChild(oDiv);
        count++;
    }
    function delFile(obj) {
        var oDiv = obj.parentNode;
        var fileBlock = document.getElementById("MultiFileDiv");
        fileBlock.removeChild(oDiv);
    }
</script>

<div>
    <table id="SignFrame" class="CommonPageDetails_table" style="margin-top: 5px">
        <tr>
            <td style="width: 100px">
                上传照片
            </td>
            <td style="width: 250px">
            
               <asp:Button ID="changedisplay"  OnClick="changedisplay_ServerClick" runat="server"
                    CssClass="buttonface" />
            </td>
            <td>
                <input type="hidden" id="photovalueTabName" runat="server"/>
                <input type="hidden" id="photovalueTabID" runat="server"/>
            </td>
            <td>
                <div id="MultiFileDiv">
                    <div>
                        <input type="file" name="file_0" />
                        <%--<input onclick="delFile(this)" visible="false" type="button" value="删除" /></div>--%>
                </div>
                <%--<input type="button" value="增加附件" visible="false" onclick="addFile()" class="buttonface" />--%>
                <asp:Button ID="btnLoadFile" Text="上传" OnClick="btnLoadFile_ServerClick" runat="server"
                    CssClass="buttonface" />
            </td>
            <td>
            <a id="mutiupload" runat="server">批量上传</a>
            </td>
        </tr>
    </table>
    
    <div id="bigphotodiv" runat="server"></div>
    <asp:GridView ID="gvUploadedFiles" runat="server" AutoGenerateColumns="false" CssClass="CommonPageDetails_table"
        Style="width: 100%; margin-top: 5px" OnRowCommand="gvUploadedFiles_RowCommand" >
        <Columns>
            <asp:TemplateField HeaderText="编号">
                <ItemTemplate>
                    <asp:LinkButton ID="lbIndex" Text='<%# gvUploadedFiles.Rows.Count+1 %>' CommandName="DownloadFile"
                        CommandArgument='<%#gvUploadedFiles.Rows.Count %>' runat="server"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:ButtonField DataTextField="FILENAME" CommandName="DownloadFile" HeaderText="文件名" />
            <asp:TemplateField HeaderText="缩略图">
                <ItemTemplate>
                    <%--<a href='<%# "ImageHandler.ashx?Photoid="+Eval("AUTOID")+"&IsBigPhoto=true" %>'>--%>
                        <img src='<%# "ImageHandler.ashx?Photoid="+Eval("AUTOID") %>' alt="缩略图" width="100px"
                            height="100px" />
                    <%--</a>--%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:ButtonField ButtonType="Link" HeaderText="上传日期" CommandName="DownloadFile" DataTextField="CREATEDT" />
            <asp:ButtonField ButtonType="Link" HeaderText="删除" Text="删除" CommandName="DeleteFile" />
            <asp:ButtonField ButtonType="Link" HeaderText="复制到设备" Text="复制到设备" CommandName="TransFile" />
        </Columns>
    </asp:GridView>
    <div align="center"><input type="button" id="backbt" name="backbt" style="width:50px;height:20px" value="返回" runat ="server"   OnServerClick="Back_ServerClick" class="buttonface"/></div>
    <%--<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>--%>
</div>
